﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProgrammerToolsKits.Comic.Interface
{
    public interface IComicPageEnumerator
        :IEnumerable<IComicPage>,IEnumerator<IComicPage>
    {
        IComicBook Book { get; }
        IComicVolume Volume { get; }
        void Load(IComicVolume volume, IComicBook book);
    }

    public static class ExtensionIComicPageEnumerator
    {
        public static IReadOnlyList<IComicPage> GetAllPage(this IComicPageEnumerator enumerator)
        {
            List<IComicPage> list = new List<IComicPage>();
            foreach(var i in enumerator)
            {
                list.Add( new Modal.ComicPage()
                {
                    Source = i.Source
                } );
            }
            return list;
        }
    }
}
